package com.sky.controller.admin;

import com.sky.result.Result;
import com.sky.service.WorkspqceService;
import com.sky.vo.BusinessDataVO;
import com.sky.vo.DishOverViewVO;
import com.sky.vo.OrderOverViewVO;
import com.sky.vo.SetmealOverViewVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

@RestController
@RequestMapping("/admin/workspace")
@Api(tags = "工作台接口")
@Slf4j
public class WorkspaceController {
    @Autowired
    private WorkspqceService workspqceService;

    @GetMapping("/businessData")
    @ApiOperation("今日数据查询")
    public Result<BusinessDataVO> businessDate(){
        BusinessDataVO businessDataVO=  workspqceService.getBusinessDate();
      return Result.success(businessDataVO);
    }

    @GetMapping("/overviewOrders")
    @ApiOperation("订单管理")
    public Result<OrderOverViewVO> overviewOrders(){
        OrderOverViewVO orderOverViewVO= workspqceService.getOverviewOrders();
        return Result.success(orderOverViewVO);
    }

    @GetMapping("/overviewDishes")
    @ApiOperation("菜品总览")
    public Result<DishOverViewVO> overviewDishes(){
       DishOverViewVO dishOverViewVO= workspqceService.getOverviewDishes();
       return Result.success(dishOverViewVO);
    }

    @GetMapping("/overviewSetmeals")
    @ApiOperation("套餐预览")
    public Result<SetmealOverViewVO> overviewSetmeals(){
        SetmealOverViewVO setmealOverViewVO=workspqceService.getOverviewSetmeals();
        return Result.success(setmealOverViewVO);
    }

}
